import time

from celery import Celery

broker_url_mq = 'pyamqp://vipcj:cqcoll123@192.168.31.123:5672/test_celery'
broker_url_redis = 'redis://192.168.31.36:6378/4'
result_backend = 'redis://192.168.31.36:6378/5'
app = Celery("proj",
             broker=broker_url_redis,
             backend=result_backend,
             include=['proj.tasks'])

app.conf.update(
    result_expires=3600,
)

if __name__ == '__main__':
    app.start()
# tasks为文件名
# celery -A proj worker --pool=eventlet --loglevel=info
